<style>
.setimg{
	margin:-2px 5px 0 0 
}
#addform .file{
	position: relative;
}
#addform .file span{
	position: absolute;
	right: 80px;
	top: 15px;
	background-color: #414959;
	padding: 2px 6px;
	height: 23px;
	line-height: 23px;
	cursor: pointer;
	color: #fff;
	font-size: 14px;
	overflow: hidden;
	background-image: linear-gradient(to bottom, #6c7994, #414959);
	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
	border: 1px solid #363d4a;
	display: inline-block;
	*display: inline;
	*zoom: 1;
}
#addform .file span input{
	position: absolute;
	font-size: 100px;
	left: 0;
	top: 0;
	opacity: 0;
	filter: alpha(opacity=0);
	cursor: pointer;
}
</style>
<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
		<!-- <button class="btn btn-primary ifrm" data-url="/index/addInput" data-width="720" data-height="650" data-title="录入信息" data-params="" style="float:right;padding:3px 6px">录入信息</button> -->
	    <div class="btn-toolbar">
		    <form>
		    	<input class="input input-medium" type="text" name="card_number" value="<?=I('get.card_number')?>" style="width: 80px;text-align: center" placeholder="卡券编号"/>
		    	<input class="input input-medium" type="text" name="user_name" value="<?=I('get.user_name')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="顾客名字"/>
		    	<input class="input input-medium" type="text" name="user_mobile" value="<?=I('get.user_mobile')?>" style="width: 100px;margin-left:10px;text-align: center" placeholder="顾客手机"/>
				<select name="xiubu_type" style="margin-left: 10px;width: 130px;">
					<option value="">修补类型/所有</option>
					<option value="1" <?=I('get.xiubu_type')==1?'selected':''?>>本人修补</option>
					<option value="2" <?=I('get.xiubu_type')==2?'selected':''?>>他人修补</option>
				</select>
		    	<!--<input class="input input-medium" type="text" name="counselor" value="<?=I('get.counselor')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="咨询师"/>-->
		    	<!--<input class="input input-medium" type="text" name="designer" value="<?=I('get.designer')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="设计师"/>-->
		    	<!--<input class="input input-medium" type="text" name="director" value="<?=I('get.director')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="课长"/>-->
		    	<!--<input class="input input-medium" type="text" name="classroom" value="<?=I('get.classroom')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="科室"/>-->
		    	<!--<input class="input input-medium" type="text" name="shopper" value="<?=I('get.shopper')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="店家"/>-->
		    	<!--<input readonly name="stime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" placeholder="组会时间-开始" value="<?=I('get.stime')?>" style="width:100px;margin-left:10px;text-align: center"/>&nbsp;-->
                <!--<input readonly style="margin-left:10px;width: 100px;text-align: center" name="etime" placeholder="组会时间-结束" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.etime')?>"/>-->
                <!--<input readonly name="xq_stime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" placeholder="销券时间-开始" value="<?=I('get.xq_stime')?>" style="width:100px;margin-left:10px;text-align: center"/>&nbsp;-->
                <!--<input readonly style="margin-left:10px;width:100px;text-align: center" name="xq_etime" placeholder="销券时间-结束" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.xq_etime')?>"/>-->
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
			<form id="addform" action="/index/repairImport" method="post" enctype="multipart/form-data">
				<p class="file">
					请选择要导入的CSV文件：<br/>
					<span>
						<input type="file" name="file">
						导入数据
					</span><!--<input type="submit" class="btn" value="导入CSV">-->
				</p>
			</form>
		    <!--<a href="/index/inputExportExcel?card_number=<?=I('get.card_number')?>&user_name=<?=I('get.user_name')?>&user_mobile=<?=I('get.user_mobile')?>&xq_stime=<?=I('get.xq_stime')?>&xq_etime=<?=I('get.xq_etime')?>"><button class="btn btn-primary" style="position:relative;float:right;padding:3px 6px;margin-right:0px;margin-top: -15px;">导出数据</button></a>-->
		</div>
		<hr>

<?php
	$salerType = ['1'=>'一次性10张','2'=>'一次性50张','3'=>'一次性500张'];
?>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center;">卡券编号</th>
		          <th style="text-align:center;">销券人</th>
					<th style="text-align:center;">修补类型</th>
					<th style="text-align:center;">修补金额</th>
					<th style="text-align:center;">修补人手机</th>
					<th style="text-align:center;">修补人姓名</th>
					<th style="text-align:center;">销售类型</th>
					<th style="text-align:center;">店家</th>
					<th style="text-align:center;">服务商</th>
					<th style="text-align:center;">课区</th>
					<th style="text-align:center;">课长</th>
					<th style="text-align:center;">医生</th>
					<th style="text-align:center;">仪器护士</th>
					<th style="text-align:center;">配台护士</th>
					<th style="text-align:center;">咨询师</th>
					<th style="text-align:center;">直接咨询师</th>
					<th style="text-align:center;">间接咨询师</th>
					<th style="text-align:center;">设计师</th>
					<th style="text-align:center;">高级设计师</th>
					<th style="text-align:center;width: 120px;">修补套餐</th>
					<th style="text-align:center;">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($getData){foreach($getData AS $key=>$val){ ?>
		        <tr> 
		          <td style="text-align:center;vertical-align:middle;"><?=$val['card_number']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['input_name']?></td>
					<td style="text-align:center;vertical-align:middle;">
					<?=$val['xiubu_type']==1?'本人修补':($val['xiubu_type']==2?'他人修补':'')?>
					</td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['xiubu_money']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['user_mobile']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['user_name']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$salerType[$val['sales_type']]?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['shoper']?></td>
		            <td style="text-align:center;vertical-align:middle;"><?=$val['servicer']?></td>
					<td  style="text-align:center;vertical-align:middle;"><?=$val['class_area']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['director']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['doctor']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['instrument_nurse']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['matching_nurse']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['counselor']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['direct_counselor']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['indirect_counselor']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['designer']?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['senior_designer']?></td>
		          	<td style="text-align:center;vertical-align:middle;"><?=$val['use_project']?></td>

					<td style="text-align:center;vertical-align:middle;">
					<a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/index/getXiubuInfo" style="padding: 0px 4px;" data-width="720" data-height="700" data-title="修改信息" data-params="id/<?=$val['id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;
					<!--<?php if(session('role_id') == 1 ){?>-->
					 <!--<a href="/index/delInput?id=<?=$val['id']?>" class="decate btn btn-danger" style="padding: 0px 4px;" role="button" title="删除信息" data-toggle="modal"><i class="icon-remove"></i></a>&nbsp;&nbsp;-->
					<!--<?php }?>-->
				 </td>
		        </tr>
		        <?php }}else{?>
		        	<tr><td style="text-align:center" colspan=16>暂无数据</td></tr>
		        <?php }?>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<script>
$(function(){
	$('.decate').click(function(){
		if(!window.confirm('确认'+$(this).attr('title')+'吗 ?')){
			return false;
		}
		window.location = $(this).attr('href');
	});

	$('input[name=file]').change(function(){
		var formData = new FormData($( "#addform" )[0]);
		$.ajax({
			url: '/index/repairImport',
			type: 'POST',
			dataType: 'json',
			contentType: false,
          	processData: false,
			data: formData,
			success:function(d){
					if(d.code == 0){
						showmsg('导入成功',1);
						setTimeout(function(){window.location.href='/index/repair?res=0-3';},2000);
					}else{
						showmsg(d.msg);
						return false;
					}
                
            }
			})
		})
})
</script>